from appium.webdriver.common.mobileby import MobileBy
from app_study.app_snowball_po.base.snowball_app import SnowballApp


class SearchPage(SnowballApp):

    def input_searchcontent(self,searchkey):
        # input search content
        self.fing_and_send(MobileBy.ID, "com.xueqiu.android:id/search_input_text",searchkey)
        return self

    def click_searchresult(self,text):
        # 点击阿里巴巴
        self.find_and_click(MobileBy.XPATH, f"//*[@text='{text}']")

        from app_study.app_snowball_po.page.search_result_page import SearchResultPage
        return SearchResultPage(self.driver)